package com.sqllog.messageMutipyThread;


public class ErrorMessageConsumer implements Runnable{

    private MessageManagerResource resource;
    /**
     * canal 客户端的运行状态
     */
    private volatile boolean running = true;

    public void setRunning(boolean running) {
        this.running = running;
    }

    public ErrorMessageConsumer(MessageManagerResource resource) {
        this.resource = resource;
    }

    @Override
    public void run() {
        while (this.running) {
            resource.consumerErrorMessage();
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
    
}